<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/10 0010
 * Time: 12:04
 */
$init=inotify_init(); //初始化

include 'test.php';
$files=get_included_files();

foreach ($files as $file){
    inotify_add_watch($init,$file,IN_MODIFY); //监视相关的文件
}

//监听
swoole_event_add($init,function ($fd){
    $events=inotify_read($fd);
    if(!empty($events)){
        echo '修改文件了';
    }
});